<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>迭代器</title>
</head>
<body>
    <script>
        //声明一个数组
        let arr = ['显示器','音响','键盘','麦克风','大台灯'];

        //遍历
        // for(let v of arr){
        //     console.log(v);
        // }
        
        //输出
        //调用 Symbol.iterator 方法   返回指针对象
        // let res = arr[Symbol.iterator]();

        // console.log(res.next());// {value: '显示器', done: false}
        // console.log(res.next());
        // console.log(res.next());
        // console.log(res.next());
        // console.log(res.next());
        // console.log(res.next());



    </script>
</body>
</html>